<template>
    <div>
        <van-nav-bar title="账号设置" left-text="返回" left-arrow @click-left="onClickLeft" />
        <div class="list">
            <!-- 退出账号 -->
            <div @click="listQuit" class="list1">退出账号</div>
            <div @click="clearData" class="list1">清除缓存</div>
            <div @click="about" class="list1">关于</div>
        </div>
    </div>
</template>

<script>
import { Dialog } from "vant";
export default {
    components: {
        [Dialog.Component.name]: Dialog.Component,
    },
    methods: {
        onClickLeft() {
            this.$router.go(-1);
        },
        listQuit() {
            Dialog.confirm({
                title: "退出账号",

                message: "确认退出账号？",
            })
                .then(() => {
                    // on confirm\
                    console.log(this.$store.getters["common/token"]);
                    this.$router.push("/login");
                    this.$store.commit("common/mutationsToken", "");
                })
                .catch(() => {});
        },
        // 清除缓存
        clearData() {
            alert("缓存数据清除成功！");
        },
        // 关于
        about() {
            Dialog.confirm({
                title: "鑫源",
                message: "1.3.2",
            })
                .then(() => {
                    // on confirm
                })
                .catch(() => {
                    // on cancel
                });
        },
    },
};
</script>

<style lang="less" scoped>
@import "@/style/index.less";
.list {
    margin: 15px 0 0 0;
    .list1 {
        font-size: 16px;
        color: rgb(75, 75, 75);
        background: #fff;
        border-bottom: 1px rgb(238, 238, 238) solid;
        padding: 5px 10px;
    }
}
</style>